package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.StaticForMarketActivityEntity;
import com.xbongbong.saas.domain.entity.StaticForMarketUpdateEntity;

import java.util.List;

/**
 * @author guohui.zhang
 * @Title:
 * @date 2020/12/1815:44
 */
public interface MarketActivityForStaticModel extends IModel<StaticForMarketActivityEntity> {

    /**
     * 批量插入
     * @param corpid
     */
    void insertBatch(List<StaticForMarketActivityEntity> list, String corpid) throws XbbException;
    /**
     * 批量删除
     */
    Integer deleteBatch(List<Long> list, String corpid, Integer del) throws XbbException;
    
    /**
     * @param idList
     * @param corpid
     * @param marketId
     * @param del
     * @return
     * @throws XbbException
     */
    Integer updateByMarketIdAndDel(List<Long> idList,String corpid, Long marketId, Integer del) throws XbbException;
    
    /**
     * 物理删除
     * @param idList
     * @param corpid
     * @param marketId
     * @return
     * @throws XbbException
     */
    Integer deleteByMarketId(List<Long> idList, String corpid, Long marketId) throws XbbException;

    /**
     * 批量修改
     * @param list
     * @param corpid
     */
    void updateBatch(List<StaticForMarketUpdateEntity> list, String corpid) throws XbbException;

    /**
     * 获取一条市场
     * @param marketId
     * @param corpid
     * @return
     */
    StaticForMarketActivityEntity getByMarketId(Long marketId, String corpid) throws XbbException;
    /**
     * 获取一条对应的数据
     * @param marketId
     * @param corpid
     * @return
     */
    StaticForMarketActivityEntity getByClueId(Long marketId, String corpid)throws XbbException;
    /**
     * 获取一条对应的数据
     * @param marketId
     * @param corpid
     * @return
     */
    StaticForMarketActivityEntity getByCustomerId(Long marketId, String corpid)throws XbbException;
    /**
     * 获取一条对应的数据
     * @param marketId
     * @param corpid
     * @return
     */
    StaticForMarketActivityEntity getBySaleId(Long marketId, String corpid)throws XbbException;

    void updateBatchForStatic(List<StaticForMarketActivityEntity> updateEntitys) throws XbbException;

    /**
     * 根据线索id分组取出客户数据
     * @param aLong
     * @param corpid
     * @return
     * @throws XbbException
     */
    List<StaticForMarketActivityEntity> getEntitysForClueDeduplication(Long aLong, String corpid) throws XbbException;

    /**
     * 根据依据客户id ,分组线索id, 查出对应的数据
     * @param aLong
     * @param corpid
     * @return
     * @throws XbbException
     */
    List<StaticForMarketActivityEntity> getEntitysForCustomerDeduplication(Long aLong, String corpid) throws XbbException;

    /**
     * 根据依据机会id ,分组线索id, 查出对应的数据
     * @param aLong
     * @param corpid
     * @return
     * @throws XbbException
     */
    List<StaticForMarketActivityEntity> getEntitysForOpportunityDeduplication(Long aLong, String corpid) throws XbbException;
}
